package com.zyf.project.kvdb.protocol.proto;

import com.zyf.project.binaryproto.annotation.DataContract;
import com.zyf.project.binaryproto.annotation.DataField;
import com.zyf.project.binaryproto.type.PrimitiveType;
import com.zyf.project.kvdb.protocol.constants.Constants;
import utils.binary.impl.Bytes;

/**
 * <h1>返回消息</h1>
 *
 * @author Zhou Yifan
 */
@DataContract(code = Constants.RESPONSE)
public interface Response extends MessageContent {

    /**
     * 获取状态码
     *
     * @return 状态，{@link Constants#SUCCESS} {@link Constants#ERROR}
     */
    @DataField(order = 0, primitiveType = PrimitiveType.INT32)
    int getCode();

    /**
     * 获取返回结果
     *
     * @return {@link Bytes} 类型数组
     */
    @DataField(order = 1, list = true, primitiveType = PrimitiveType.BYTES)
    Bytes[] getResult();
}
